package com.edie.customview.basemvp;

import android.os.Bundle;

/**
 * - @Description:  mvp fragment 基类
 * - @Author:  edie
 * - @Time:  2018/8/10 下午4:29
 */
public abstract class BaseMvpFragment<P extends IPresenter> extends BaseFragment implements IView {


    protected P mPresenter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = initPresenter();
    }

    protected abstract P initPresenter();

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.onDetach();
        }
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void showError() {

    }
}
